<?php
namespace App\Http\Controllers;

use App\Http\Logic\RegionLogic;
use Illuminate\Http\Request;

class RegionController extends Controller
{
    public function getProvinces(Request $request)
    {
        return RegionLogic::getProvinces();
    }

    public function getCities(Request $request)
    {
        $provinceId = $request->get('q');
        return RegionLogic::getCities($provinceId);
    }

    public function getDistricts(Request $request)
    {
        $cityId  = $request->get('q');
        return RegionLogic::getDistricts($cityId);
    }
}
